package AliDiepPR.ANN.ActivationFunction;

public class SigmoidFunction implements IActivationFunction {

	double alfa = 1f;

	public SigmoidFunction() {
	}

	public SigmoidFunction(double alfa) {
		this.alfa = alfa;
	}

	@Override
	public void Alfa(double alfa) {
		this.alfa = alfa;
	}

	@Override
	public double output(double x) {
		return (double) 1 / ((double) 1 + (double) Math.exp(-alfa * x));
	}

	@Override
	public double output2(double y) {
		return y * (1 - y);
	}

	public String ToString() {
		return "Sigmoid Func";
	}
}
